package com.xci.sys.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelIgnore;
import com.xci.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 系统字典
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(description = "系统字典")
public class SysDic extends BaseEntity {
    /**
     * 字典主键
     */
    @ExcelIgnore @Excel(name = "字典主键")
    @ApiModelProperty(value = "字典主键", required = true, position = 1)
    private String id;

    /**
     * 字典上级主键
     */
    @NotBlank(message = "字典上级主键不能为空")
    @Length(max = 30, message = "字典上级主键不能超过{max}个字符")
    @ExcelIgnore @Excel(name = "字典上级主键")
    @ApiModelProperty(value = "字典上级主键", required = true, position = 2)
    private String parentId;

    /**
     * 字典名称
     */
    @NotBlank(message = "字典名称不能为空")
    @Length(max = 100, message = "字典名称不能超过{max}个字符")
    @Excel(name = "字典名称", width = 30d)
    @ApiModelProperty(value = "字典名称", required = true, position = 4)
    private String name;

    /**
     * 字典名称简拼
     */
    @Length(max = 100, message = "字典名称简拼不能超过{max}个字符")
    @ExcelIgnore@Excel(name = "简拼")
    @ApiModelProperty(value = "字典名称简拼", position = 6)
    private String spell;

    /**
     * 字典类型编码
     */
    @NotBlank(message = "字典类型编码不能为空")
    @Length(max = 100, message = "字典类型编码不能超过{max}个字符")
    @Excel(name = "字典类型编码", width = 30d)
    @ApiModelProperty(value = "字典类型编码", required = true, position = 3)
    private String code;

    /**
     * 字典值
     */
    @NotNull(message = "字典值不能为空")
    @Length(max = 100, message = "字典值不能超过{max}个字符")
    @Excel(name = "字典值", width = 30d)
    @ApiModelProperty(value = "字典值", required = true, position = 5)
    private String value;

    /**
     * 序号
     */
    @Excel(name = "序号")
    @ApiModelProperty(value = "序号", required = true, position = 7)
    private Long path;

    /**
     * 启用状态 [启用_1,禁用_0]
     */
    @Excel(name = "启用状态", replace = {"启用_true", "禁用_false"})
    @ApiModelProperty(value = "启用状态 [启用_1,禁用_0]", position = 8)
    private Boolean status;

    /**
     * 备注
     */
    @Length(max = 200, message = "备注不能超过{max}个字符")
    @Excel(name = "备注", width = 40d)
    @ApiModelProperty(value = "备注", position = 100)
    private String remark;
}